package com.jd.platform.sample4.service.Impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.jd.platform.sample4.entity.pojo.Produce;
import com.jd.platform.sample4.mapper.ProduceMapper;
import com.jd.platform.sample4.service.Produce2Service;
import com.jd.platform.sample4.service.redis.Produce2ServiceRedis;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class Produce2ServiceImpl extends ServiceImpl<ProduceMapper, Produce> implements Produce2Service {
    @Autowired
    private Produce2ServiceRedis produce2ServiceRedis;

    @Override //有attribute则返回某属性值，没有则返回Produce
    public Object getById_Redis(long id,String... attributes) throws Exception {
        return produce2ServiceRedis.getById_Redis(id,attributes);
    }

    @Override
    public void InsertOrUpdate_Redis(Object object) throws Exception {
        produce2ServiceRedis.InsertOrUpdate_Redis(object); //Produce或List<Produce>
    }

    @Override
    public void deleteById_Redis(Object object) throws Exception {
        produce2ServiceRedis.deleteById_Redis(object); //long或list<Long>
    }
}
